<template>
  <div class="card">
    <div class="card-header">
      <span>{{ title }}</span>
      <i class="el-icon-warning-outline" />
    </div>
    <div class="card-body">
      <div class="card-body-value">{{ value }}</div>
      <div class="card-body-container"><slot /></div>
    </div>
    <div class="card-footer">
      <slot name="footer" />
    </div>
  </div>
</template>

<script>
export default {
  name: "Card",
  props: {
    title: {
      type: String,
      default: "",
    },
    value: {
      type: String,
      default: "",
    },
  },
};
</script>

<style lang="scss" scoped>
.card {
  color: #303133;
  background-color: #fff;
  box-shadow: 0 2px 12px 0 rgb(0 0 0 / 10%);
  padding: 20px;
}

.card-header {
  display: flex;
  justify-content: space-between;
  span,
  i {
    color: rgba(0, 0, 0, 0.45);
    font-size: 16px;
  }
}
.card-body {
  padding: 10px 0 5px 0;
  margin-bottom: 5px;
  border-bottom: 1px solid #f0f0f0;
}
.card-body-value {
  color: rgba(0, 0, 0, 0.85);
  font-size: 30px;
  align-items: flex-end;
}
.card-body-container {
  height: 50px;
  display: flex;
  align-items: flex-end;
}
</style>
